#pragma once
#include <vector>
#include <fstream>
#include <sstream>

#include "BaseElement.h"
#include "math.h"
using namespace std;

bool RmwWriteByteImg2BmpFile(byte* pImg, long width, long height, const char* filename);

byte* RmwRead8BitBmpFile2Img(const char* filename, long& width, long& height);

void Stringsplit(string str, const const char split, vector<string>& res);

void getPoint(const char* fileName, vector<point>& PP);

class dealBMP {
private:
	byte* m_picA = nullptr;
	int bmpW;
	int bmpH;
	int maxGray;
	int minGray;
	const char* filePic;
public:
	dealBMP(const char* filename);
	dealBMP(const char* filename, int& picW, int& picH);
	~dealBMP();
	bool writePic1(byte* pic);
	bool writePic2(byte** pic);
	int picWidth() { return bmpW; }
	int picHeight() { return bmpH; }
	int maxG() { return maxGray; }
	int minG() { return minGray; }
	byte* pic() { return m_picA; }
};